<template>
	<view class="mask" v-show="showMask" @click="clearMask">
		<view class="box">
			<view class="title">
				{{title}}
			</view>
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		name: "wy-mask",
		props: {
			showMask: {
				default: false,
				// required: true
			},
			title: {
				default: '头部标题',
				// required: true
			}
		},
		data() {
			return {

			};
		},
		methods: {
			clearMask() {
				this.$emit('changeShow', false)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mask {
		height: 100%;
		width: 100%;
		background-color: rgba(0, 0, 0, 0.3);
		z-index: 99;
		position: absolute;
		top: 0;
		left: 0;
	}

	.box {
		.title {
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			background-color: #37b9f3;
			border-top-left-radius: 40rpx;
			border-top-right-radius: 40rpx;
		}

		border-top-left-radius: 40rpx;
		border-top-right-radius: 40rpx;
		background-color: #fff;
		height: 400rpx;
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
	}
</style>
